package strategy_pattern.v3;

/**
 * 现金收费工厂
 */
public class CashFactory {
    public static CashSuper createCashSuper(BenefitEnum benefitType) {
        CashSuper cashSuper = null;
        switch (benefitType) {
            case NormalBenefit:
                cashSuper = new CashNormal();
                break;
            case EightDiscountRebateBenefit:
                cashSuper = new CashRebate(0.8);
                break;
            case SevenDiscountRebateBenefit:
                cashSuper = new CashRebate(0.7);
                break;
            case HalfDiscountRebateBenefit:
                cashSuper = new CashRebate(0.5);
                break;
            case EveryThreeRetOneHundredDBenefit:
                cashSuper = new CashReturn(300, 100);
                break;
        }
        return cashSuper;
    }
}
